package com.tc168.cp306.b06.activity;

import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.maning.mndialoglibrary.MProgressDialog;
import com.tc168.cp306.b06.R;
import com.tc168.cp306.b06.Utils.GlideImageLoader;
import com.youth.banner.Banner;

import java.util.ArrayList;

public class BangzhufourActivity extends AppCompatActivity {


    private ArrayList<Integer> imagePath;
    private TextView titledi;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bangzhu);


        MProgressDialog.showProgress(this);


        new Handler().postDelayed(new Runnable() {

            @Override

            public void run() {
                MProgressDialog.dismissProgress();
            }
        }, 1000);
        ImageView imageback = (ImageView) findViewById(R.id.back_ig);

        TextView title = (TextView) findViewById(R.id.title);

        title.setText("查看帮助");
        titledi = (TextView) findViewById(R.id.title_di);
        Banner banner = (Banner) findViewById(R.id.banner);
        imagePath = new ArrayList<>();
        imagePath.add(R.mipmap.help_addnote_1);
        imagePath.add(R.mipmap.help_addnote_2);
        imagePath.add(R.mipmap.help_addnote_3);
        imagePath.add(R.mipmap.help_addnote_4);
        titledi.setText("进入题目所在的答题类型，找到想要收藏的题目");
        imageback.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        //
        //设置图片加载器
        banner.setImageLoader(new GlideImageLoader());
        //设置图片集合
        banner.setImages(imagePath);
        //banner设置方法全部调用完毕时最后调用
        banner.start();


        banner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
            @Override
            public void onPageScrolled(int page, float v, int i1) {


            }

            @Override
            public void onPageSelected(int pagenum) {

                if (pagenum == 0) {
                    titledi.setText("进入题目所在的答题类型，找到想要收藏的题目");
                }
                if (pagenum == 1) {
                    titledi.setText("向左滑动想要收藏的题目");
                }
                if (pagenum == 2) {
                    titledi.setText("出现一个收藏按钮，点击收藏");
                }
                if (pagenum == 4) {
                    titledi.setText("即收藏成功");
                }

            }

            @Override
            public void onPageScrollStateChanged(int i) {

            }
        });
    }
}
